//
//  Public.h
//  Network
//
//  Created by phq on 2019/7/4.
//  Copyright © 2018 job1001. All rights reserved.
//

#import <Foundation/Foundation.h>
@class UIAlertAction;
NS_ASSUME_NONNULL_BEGIN

@interface HPHelper : NSObject


#pragma mark - token业务相关

/// 生成GMT时间，如：Wed 17 Oct 2018 01:29:18 GMT
+ (NSString *)stringFromDateGMT;


#pragma mark - 数据加解密
// url utf8
+ (NSString *)utf8Encode:(NSString*)text;

// 将指定的数据进行DES加密 ，
+ (NSData*)encryptDES:(NSString*)text withKey:(NSString *)key;

// 对指定的数据进行DES解密
+ (NSData*)decryptDES:(NSData*)text withKey:(NSString *)key;

//  base64 加解密
+ (NSString *)base64EncodedWithData:(NSData *)data;
+ (NSString *)base64EncodedWithString:(NSString *)str;
+ (NSData *)dataWithBase64EncodedString:(NSString *)string;

// md5 加密
+ (NSString *)md5WithString:(NSString *)string;
// hmacsha1 算法
+ (NSString *)hmacsha1WithString:(NSString *)string withKey:(NSString *)key;

// 中文 unicode
+ (NSString *)unicodeEncode:(NSString*)text;
#pragma mark - 其它

// 字典 -> JSON字符串
+ (NSString *)stringWithJson:(id)dict;

// JSON字符串 -> 字典
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

//获取系统可用空间大小 单位byte
+ (long long)getSystemCanUseMemoryNotUnit;

// 简单的Alert（只有“确定”按钮）
+ (void)alertWithMessage:(nonnull NSString *)message handler:(void (^ __nullable)(UIAlertAction *action))handler;

//model转NSDictionary
+ (NSDictionary *)properties_aps:(id)model;

//判断是否是纯汉字
+ (BOOL)isChinese:(NSString *)str;
//判断是否含有汉字
+ (BOOL)includeChinese:(NSString *)str;

@end

NS_ASSUME_NONNULL_END
